function bcoe_eyelink2_setup(file_name)

if (Eyelink('initialize') ~= 0)
	clc
	disp(' ');
	error('   EYELINK(`initialize`) failed!!!' )
	return;
end;
clc;
%file_name=input('Input file name:','s');
i = EYELINK('openfile',[file_name,'.edf']);
if i~=0
	EYELINK('Shutdown');
	disp(' ');
	error(['Cannot create EDF file: ' file_name]);
    return;
end
EYELINK('command', 'add_file_preamble_text', 'Recorded by BCOE');
%   SET UP TRACKER CONFIGURATION
eyelink('command', 'calibration_type = HV9');
%	set parser (conservative saccade thresholds)
eyelink('command', 'saccade_velocity_threshold = 35');
eyelink('command', 'saccade_acceleration_threshold = 9500');
%	set EDF file contents
% eyelink('command', 'file_event_filter = LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE');
eyelink('command', 'file_event_filter = LEFT,RIGHT,MESSAGE');
% Sets which types of events will be written to EDF file. See tracker file
% DATA.INI for types.
% Arguments: <list>: list of event types
% LEFT, RIGHT events for one or both eyes
% FIXATION fixation start and end events
% FIXUPDATE fixation (pursuit) state updates
% SACCADE saccade start and end
% BLINK blink start an end
% MESSAGE messages (user notes in file)
% BUTTON button 1..8 press or release
% INPUT changes in input port lines
eyelink('command', 'link_event_filter = LEFT,RIGHT,FIXATION');
% Sets which types of events will be sent through link. See tracker file
% DATA.INI for types.
% Arguments: <list>: list of event types
% LEFT, RIGHT events for one or both eyes
% FIXATION fixation start and end events
% FIXUPDATE fixation (pursuit) state updates
% SACCADE saccade start and end
% BLINK blink start an end
% MESSAGE messages (user notes in file)
% BUTTON button 1..8 press or release

eyelink('command', 'link_sample_data  = LEFT,RIGHT,GAZE,AREA');
% Sets data in samples sent through link. See tracker file DATA.INI for
% types.
% Arguments: <list>: list of data types
% GAZE screen xy (gaze) position
% GAZERES units-per-degree screen resolution
% HREF head-referenced gaze
% PUPIL raw eye camera pupil coordinates
% AREA pupil area
% STATUS warning and error flags
% BUTTON button state and change flags
% INPUT input port data lines
